package com.dai.spec.gxk.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.dai.spec.common.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 教师信息管理对象 t_spec_teacher
 *
 * @author daikl
 * @date 2024-02-29
 */
@TableName("t_spec_teacher")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Teacher implements Serializable {
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    @NotNull
    private Long id;

    /**
     * 工号
     */
    @Excel(name = "工号")
    @NotBlank
//    @Length(min = 12, max = 12, message = "工号长度必须为12位")
    //todo 工号校验
    private String jobNumber;

    /**
     * 姓名
     */
    @Excel(name = "姓名")
    @NotBlank(message = "姓名不能为空")
    private String name;

    /**
     * 性别
     * '0'男，‘1’女
     */
    @Excel(name = "性别")
    @NotBlank(message = "性别不能为空")
    private String sex;

    /**
     * 职称
     * ‘0’ 助教
     * ‘1’ 讲师
     * ‘2’ 副教授
     * ‘3’ 教授
     */
    @Excel(name = "职称")
    @NotBlank(message = "职称不能为空")
    private String professionalTitle;

    /**
     * 手机号码
     */
    @Excel(name = "手机号码")
    @NotBlank(message = "手机号码不能为空")
    //todo 加入在正则校验
    private String phoneNumber;

    /**
     * 年龄
     */
    @Excel(name = "年龄")
    @NotNull(message = "年龄不能为空")
    private Long age;

    /**
     * 创建人
     */
    @TableField(fill = FieldFill.INSERT)
    private String createUser;

    /**
     * 更新人
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String updateUser;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private LocalDateTime updateTime;

    /**
     * 用户id
     */
    private Long userId;
}
